var Public = function() {
    var initHost = 'http://g.g/Hopscotch/www/index.php?s=Home/System/getJsConfig';
    var ajaxConfig = null;
    return {
        ajax: function(name, success, error) {
            if (typeof (ajaxConfig[name]) == "undefined") {
                console.log("未找到ajax地址[%s]定义，请通过服务器配置。", name);
                return false;
            }
            $.ajax({
                url: ajaxConfig[name]['url'],
            });
        },
        config: function() {
//            alert("ok");
            $.ajax({url: initHost,
                dataType: "jsonp",
                jsonp: "callback",
                timeout: 3000,
                async: false,
                type: 'get',
                success: function(rs) {
                    ajaxConfig = rs['data']['ajax'];
//                    alert(ajaxConfig);
                }, error: function(XMLHttpRequest, textStatus, errorThrown) {
                    alert("sorry，页面初始化失败，请联系管理员获得帮助。");
                },
            });
        }
    };
}();